#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
    int N;
    cin >> N;
    int result = 0;
    result += (N / 50) * 7;
    N %= 50;
    result += (N / 30) * 4;
    N %= 30;
    result += (N / 10);
    cout << result << endl;
    return 0;
}